<?php

class Application_Form_Pacjent extends Zend_Form {
    protected $_opiekuni = array();
    protected $_comp = array();
    protected $_placowki = array();
    public function __construct($opiekuni,$comp,$placowki) {
        $this->_opiekuni=$opiekuni;
        $this->_comp = $comp;
        $this->_placowki = $placowki;
        return parent::__construct();
    }
    public function init() {
        $this->setMethod('post');
        $this->setAction("/index/pacjent");
        $this->addElement('text', 'imie', array(
            'label' => 'Imie ('.$this->_comp['cb_imidziecka'].'): ',
            'required' => true
        ));
        $this->addElement('text', 'nazwisko', array(
            'label' => 'Nazwisko ('.$this->_comp['cb_nazwiskodziecka'].'): ',
            'required' => true
        ));
        
        
        $this->addElement('select', 'opiekun', array(
            'label' => 'Logopeda:',
            'required' => true,
            'multioptions' => $this->_opiekuni
        ));
        
        $this->addElement('select', 'placowka', array(
            'label' => 'Placówka:',
            'required' => true,
            'multioptions' => $this->_placowki
        ));
        
        $this->addElement('text','email',array(
            'label'     =>  'Email ('.
            $this->_comp['email'].
            '): ',
            'required'  => true
        ));
        
        $this->addElement('textarea','diagnoza',array(
            'label' => 'Diagnoza ('.
            $this->_comp['cb_diagnoza'].
            '): '
        ));
        
        $this->addElement('text', 'rodzic_imie', array(
            'label' => 'Imię rodzica ('.$this->_comp['firstname'].'): ',
            'required' => true
        ));
        $this->addElement('text', 'rodzic_nazwisko', array(
            'label' => 'Nazwisko rodzica ('.$this->_comp['lastname'].'): ',
            'required' => true
        ));

        $this->addElement('hidden', 'id');

        $this->addElement('submit', 'ustaw');
    }
}
